package com.codemart.lanze.modules.front;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.codemart.lanze.common.base.controller.FrontBaseController;

/**
 * 前台首页
 */
@Controller
public class PageController extends FrontBaseController {

	@RequestMapping("/")
	@ResponseBody
	public String showIndex() {
		return index();
	}

	// @RequestMapping("/{page}")
	// public String showPage(@PathVariable String page) {
	// return page;
	// }

	/**
	 * 前台首页
	 *
	 * @return
	 */
	@GetMapping(value = "")
	@ResponseBody
	public String toIndex() {
		return index();
	}

	/**
	 * 首页
	 *
	 * @return
	 */
	@GetMapping(value = "/index")
	@ResponseBody
	public String index() {
		ModelMap modelMap = new ModelMap();
		// 通过model传到页面
		modelMap.addAttribute("", "");
		log.info("------进入前台首页-------");

		return PREFIX + "index/index";
		// return "redirect:index";
	}

	/**
	 * 栏目
	 *
	 * @return
	 */
	@GetMapping(value = "/channel")
	@ResponseBody
	public String channel(ModelMap modelMap) {
		return channelIndex();
	}

	/**
	 * 栏目
	 *
	 * @return
	 */
	@GetMapping(value = "/channel/index")
	public String channelIndex() {
		ModelMap modelMap = new ModelMap();
		// 通过model传到页面
		modelMap.addAttribute("", "");
		log.info("------进入栏目首页-------");

		return PREFIX + "channel/index";
	}

}
